package cn.lstf666.springboot.web;

import cn.lstf666.springboot.model.Student;
import cn.lstf666.springboot.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.rmi.StubNotFoundException;

@Controller
public class indexController {

    @Autowired
    private StudentService studentService;


    @RequestMapping("/mybatis1")
    public @ResponseBody Student getStu(Integer id){
        Student student = studentService.getStudentById(id);
        return student;

    }

}
